package com.base.mybaseproject.base;

import android.app.Application;

import com.base.mybaseproject.imageLoader.impl.FileNameRuleImageUrl;
import com.base.mybaseproject.imageLoader.impl.ImageSDCardCache;
import com.base.mybaseproject.imageLoader.impl.RemoveTypeLastUsedTimeFirst;

public class MyApplication extends Application {

	@Override
	public void onCreate() {

		super.onCreate();
		AppHelper.newInstance().imageLoder = new ImageSDCardCache();
		AppHelper.newInstance().imageLoder.setContext(getApplicationContext());
		AppHelper.newInstance().imageLoder.setCacheFullRemoveType(new RemoveTypeLastUsedTimeFirst<String>());
		AppHelper.newInstance().imageLoder.setCacheFolder(Constant.IMAGE_PATH);
		AppHelper.newInstance().imageLoder.setFileNameRule(new FileNameRuleImageUrl());

		AppHelper.newInstance().imageLoder.setHttpReadTimeOut(10000);
		AppHelper.newInstance().imageLoder.setOpenWaitingQueue(true);
		AppHelper.newInstance().imageLoder.setValidTime(-1);
	}

}
